import { IParam, IAttr, IOption, IReturn, TValueOriginType } from './normal';

export interface IModel {
    prop: {
        value: string;
    };
    event: {
        value: string;
    };
}

export interface ISlots {
    [name: string]: ISlot;
}

export interface ISlot {
    desp?: string;
    attrs?: Array<IAttr>;
}

export interface IProp {
    desp?: string;
    default?: string | boolean | number | null | undefined;
    defaultValueType?: TValueOriginType;
    required?: boolean;
    type?: Array<string>;
    options?: Array<IOption>;
}

export interface IProps {
    [name: string]: IProp;
}

export interface IEvent {
    desp?: string;
    params?: Array<IParam>;
    behavior: 'normal' | 'update';
}

export interface IEventTurnBack {
    desp?: string;
    params?: Array<IParam>;
}

export interface IEvents {
    [name: string]: IEvent;
}

export interface IMethod {
    desp?: string;
    params?: Array<IParam>;
    returns?: IReturn;
}

export interface IMethods {
    [name: string]: IMethod;
}

export interface IScript {
    name?: string;
    model: IModel;
    props?: IProps;
    events?: IEvents;
    methods?: IMethods;
}

export interface ITemplate {
    slots?: ISlots;
}

export interface IVueSfcParseResult {
    desp?: string;
    template?: ITemplate;
    script: IScript;
}

export interface IVueSfcParseResultTurnBack {
    template?: ITemplate;
    script?: {
        props?: IProps;
        methods?: IMethods;
        events?: {
            [name: string]: IEventTurnBack;
        };
    };
}

export interface IVueSfcParseResultMdConfig {
    desp?: string;
    template?: {
        slots?: Array<Array<string>>;
    };
    script?: {
        name?: string;
        props?: Array<Array<string>>;
        events?: Array<Array<string>>;
        methods?: Array<Array<string>>;
    };
}
